<template>
  <div>
    <el-dialog title="活动信息" :visible.sync="dialogFormVisible"  :loading="loading" width="800px">
      <el-form :model="act">
        <el-form-item label="活动编号" :label-width="formLabelWidth" prop='actId'>
          <el-input v-model="act.actId" autocomplete="off" :readonly="readonly"></el-input>
        </el-form-item>
        <el-form-item label="活动名称" :label-width="formLabelWidth" prop='actTitle'>
          <el-input v-model="act.actTitle" autocomplete="off" :readonly="readonly"></el-input>
        </el-form-item>
        <el-form-item label="主办方" :label-width="formLabelWidth" prop='actHost'>
          <el-input v-model="act.actHost" autocomplete="off" :readonly="readonly"></el-input>
        </el-form-item>
        <el-form-item label="活动创造人编号" :label-width="formLabelWidth" prop='actUserId'>
          <el-input v-model="act.actUserId" autocomplete="off" :readonly="readonly"></el-input>
        </el-form-item>
        <el-form-item label="活动学部编号" :label-width="formLabelWidth" prop='actPartId"'>
          <!--<el-input v-model="act.actPartId" autocomplete="off" :readonly="readonly"></el-input>-->
          <el-input v-if="act.actPartId=='1'" value="信息学部" autocomplete="off" :readonly="readonly"></el-input>
        </el-form-item>
        <el-form-item label="活动最大人数" :label-width="formLabelWidth" prop='actMemberMax'>
          <el-input v-model="act.actMemberMax" autocomplete="off" :readonly="readonly"></el-input>
        </el-form-item>
        <el-form-item label="活动录取形式" :label-width="formLabelWidth" prop='actMemberWay'>
          <el-input v-if="act.actMemberWay=='1'" value="手动审核" autocomplete="off" :readonly="readonly"></el-input>
          <el-input v-if="act.actMemberWay=='2'" value="无需审核" autocomplete="off" :readonly="readonly"></el-input>
        </el-form-item>
        <el-form-item label="活动负责人姓名" :label-width="formLabelWidth" prop='actPrincipalName'>
          <!-- <el-date-picker v-model="act.actPrincipalName" :readonly="readonly"></el-date-picker> -->
          <el-input v-model="act.actPrincipalName" autocomplete="off" :readonly="readonly"></el-input>
        </el-form-item>
        <el-form-item label="活动负责人电话" :label-width="formLabelWidth" prop='actPrincipalPhone'>
          <el-input v-model="act.actPrincipalPhone" autocomplete="off" :readonly="readonly" type="number"></el-input>
        </el-form-item>
        <el-form-item label="活动负责人邮箱" :label-width="formLabelWidth" prop='actPrincipalEmail'>
          <el-input v-model="act.actPrincipalEmail" autocomplete="off" :readonly="readonly"></el-input>
        </el-form-item>
        <el-form-item label="活动地点" :label-width="formLabelWidth" prop='actAddress'>
          <el-input v-model="act.actAddress" autocomplete="off" :readonly="readonly"></el-input>
        </el-form-item>
        <el-form-item label="活动类型" :label-width="formLabelWidth" prop='actType'>
          <el-input v-if="act.actType=='1'" value="学部级" autocomplete="off" :readonly="readonly"></el-input>
          <el-input v-if="act.actType=='2'" value="校级" autocomplete="off" :readonly="readonly"></el-input>
        </el-form-item>
        <el-form-item label="活动状态" :label-width="formLabelWidth" prop='actStatus'>
          <el-input v-if="act.actStatus=='0'" value="待审核" autocomplete="off" :readonly="readonly"></el-input>
          <el-input v-if="act.actStatus=='1'" value="报名中" autocomplete="off" :readonly="readonly"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">关 闭</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
  import {
    getActivityByActId
  } from '../../api/act.js'
  export default {
    components: 'Info',
    name: 'Info',
    props: {
      actId: String,
      show: {
        default: false,
        require: true
      }
    },
    data() {
      return {
        act: {},
        loading: false,
        dialogFormVisible: false,
        formLabelWidth: '150px',
        title: '查看活动信息',
        readonly: true,
      }

    },
    create() {

    },
    methods: {

      showInfo(actId) {
        console.log(actId)
        this.title = "查看活动信息"
        this.readonly = true
        this.fetchData(actId)
      },
      fetchData(actId) {
        console.log(actId)
        this.loading = true
        getActivityByActId(actId).then((data) => {
          this.act = data.obj
          console.log(data)
          console.log(this.act)
          this.loading = false
          this.dialogFormVisible = true
        })
        
      }
    },
    watch: {}

  }
</script>

<style scoped>

</style>
